#include <elasticlient/client.h>
#include <cpr/cpr.h>

#include <iostream>

int main() {
    
    // 1. 构造 Elasticsearch 客户端
    elasticlient::Client client ({"http://127.0.0.1:9200/"});
    // 2. 发送搜索请求
    auto rsp = client.search("user", "_doc", "{ \"query\": { \"match_all\": {} }}");

    // 3. 打印响应状态码和响应正文
    std::cout << rsp.status_code << std::endl;
    std::cout << rsp.text << std::endl;

    return 0;
}
